<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
	<xsl:output method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
	<xsl:template match="/">
		<html xmlns="http://www.w3.org/1999/xhtml">
			<head>
				<title>Course List</title>
				<style type="text/css">
					ul{
					display: inline;
					}
 				</style>
			</head>
			<body>
				<xsl:call-template name="f">
					<xsl:with-param name="n" select="'1'" />
				</xsl:call-template>
			</body>
		</html>
	</xsl:template>
	<xsl:template name="f">
		<xsl:param name="n" />
		<h2>
			<xsl:choose>
				<xsl:when test="$n = '1'">
					Sunday
				</xsl:when>
				<xsl:when test="$n = '2'">
					Monday
				</xsl:when>
				<xsl:when test="$n = '3'">
					Tuesday
				</xsl:when>
				<xsl:when test="$n = '4'">
					Thursday
				</xsl:when>
				<xsl:when test="$n = '5'">
					Wednesday
				</xsl:when>
				<xsl:when test="$n = '6'">
					Friday
				</xsl:when>
				<xsl:when test="$n = '7'">
					Saturday
				</xsl:when>
			</xsl:choose>
		</h2>
		<xsl:if test="//day[@number = $n]/courseName[text() != '']">
			<ul>
				<xsl:for-each select="//day[@number = $n]">
					<xsl:if test="courseName[text() != '']">
						<li>
							<b><xsl:value-of select="courseName" /></b>:
							Starts on hour <xsl:value-of select="start" />
							, goes for <xsl:value-of select="duration" /> hours.
						</li>
					</xsl:if>
				</xsl:for-each>
			</ul>
		</xsl:if>
		<xsl:if test="$n &lt; 8">
			<xsl:call-template name="f">
				<xsl:with-param name="n" select="$n + 1" />
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>

